#!/bin/sh

#-fprofile-arcs  -ftest-coverage
MYFLAGS="-p -pg -ggdb3  -O0 -Wall -Werror -Wshadow"
#-pedantic

MYCC="g++";

if which "gcc-4.0" 2>/dev/null >/dev/null; then
  MYCC="g++-4.0";
fi

if which "gcc-4.1" 2>/dev/null >/dev/null; then
  MYCC="g++-4.1";
fi

if which "gcc-4.2" 2>/dev/null >/dev/null; then
  MYCC="g++-4.2";
fi

if which "gcc-4.3" 2>/dev/null >/dev/null; then
  MYCC="g++-4.3";
fi

#if which "/opt/lsb/bin/lsbc++" 2>/dev/null >/dev/null; then
#  MYCC="/opt/lsb/bin/lsbc++";
#fi

if which "ccache" 2>/dev/null >/dev/null; then
  MYCC="ccache $MYCC";
fi

echo MYCC: $MYCC
echo MYFLAGS: $MYFLAGS

OPTS="--enable-doxygen --enable-docbook"
#OPTS="$OPTS --enable-builtin-stl" # --disable-rtti" # --disable-exceptions"
OPTS="$OPTS --enable-debug=full"
#OPTS="$OPTS --host=i686-pc-linux-gnu "
#OPTS="$OPTS --build=i686-pc-linux-gnu "
#OPTS="$OPTS --disable-namespace"
OPTS="$OPTS --disable-builtin-cxxtest --enable-cppunit"
#OPTS="$OPTS --disable-builtin-cxxtest --enable-boosttest"

echo "CFLAGS=\"$MYFLAGS\" CXXFLAGS=\"$MYFLAGS\" CXX=\"$MYCC\" CC=\"$MYCC\" ${0%/*}/configure  --enable-unicode $OPTS --prefix=/tmp/mockpp-install" >mockpp-reconf.sh
chmod +x mockpp-reconf.sh

./mockpp-reconf.sh

